Cocktail Help Reference
Item Property
See Also  Send Feedback
Cocktail Assembly > Cocktail Namespace > WeakRefDictionary<TKey,TValue> Class : Item Property



key
The key to look for.

Glossary Item Box

Retrieves a value from the dictionary.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Default Property Item( _
   ByVal key As TKey _
) As TValue
Visual Basic (Usage)Copy Code
Dim instance As WeakRefDictionary(Of TKey,TValue)
Dim key As TKey
Dim value As TValue
 
value = instance.Item(key)
C# 
public TValue this[ 
   TKey key
]; {get;}
C++/CLI 
public:
property TValue^ default [TKey^] {
   TValue^ get(TKey^ key);
}

Parameters

key
The key to look for.

Property Value

The value in the dictionary.

Exceptions

ExceptionDescription
System.Collections.Generic.KeyNotFoundExceptionThrown when the key does exist in the dictionary. Since the dictionary contains weak references, the key may have been removed by the garbage collection of the object.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.